home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- if(_visible)
- {
- switch(sost)
- {
- case 2:
- if(!_level0.no_sound)
- {
- _level0.snds[_level0.snd_clock_wait].stop();
- }
- if(count >= 64)
- {
- dx = _level0.hero._x - _X;
- dy = _level0.hero._y - _Y;
- dlen = Math.sqrt(dx * dx + dy * dy);
- _X = _X + dx * speed / dlen;
- _Y = _Y + dy * speed / dlen;
- }
- case 0:
- count++;
- if(count >= 172)
- {
- sost = 1;
- }
- break;
- case 1:
- if(_currentframe < 172)
- {
- gotoAndPlay(172);
- }
- if(_currentframe >= 178)
- {
- ghost_count++;
- if(!_level0.no_sound)
- {
- _level0.snds[_level0.snd_clock_wait].stop();
- _level0.snds[_level0.snd_clock_boom].start();
- }
- _level0.monster_ghost.duplicateMovieClip("monster_ghost" + ghost_count,_level0.num_monsters + 600 + ghost_count);
- eval("_level0.monster_ghost" + ghost_count)._x = _X;
- eval("_level0.monster_ghost" + ghost_count)._y = _Y;
- eval("_level0.monster_ghost" + ghost_count).sost = 0;
- eval("_level0.monster_ghost" + ghost_count)._visible = true;
- count = 0;
- sost = 2;
- }
- break;
- case 3:
- if(!_level0.no_sound)
- {
- _level0.snds[_level0.snd_clock_wait].stop();
- }
- if(_currentframe >= 172)
- {
- gotoAndPlay(1);
- }
- dx = _level0.hero._x - _X;
- dy = _level0.hero._y - _Y;
- dlen = Math.sqrt(dx * dx + dy * dy);
- _X = _X - dx * 16 / dlen;
- _Y = _Y - dy * 16 / dlen;
- i = 1;
- while(i <= ghost_count)
- {
- eval("_level0.monster_ghost" + i).sost = 1;
- i++;
- }
- if(_X < 0 || _X > 800 || (_Y < 0 || _Y > 560))
- {
- this.removeMovieClip();
- }
- break;
- case 10:
- if(_Y < 100)
- {
- _Y = _Y + 2;
- }
- else
- {
- sost = 0;
- count = 0;
- }
- }
- if(sost != 3 && sost != 10 && !_level0.hero.immortal && (_level0.hero.sost == 1 || _level0.hero.sost == 2 || _level0.hero.sost == 3) && (_X + 20 >= _level0.hero._x - 27 && _X - 20 <= _level0.hero._x + 25) && (_Y + 32 >= _level0.hero._y - 8 && _Y - 32 <= _level0.hero._y + 28))
- {
- _level0.hero.sost = 9;
- _level0.hero.death_index = 0;
- _level0.hero._xscale = _xscale;
- _level0.hero.gotoAndPlay(_level0.hero.frame_death);
- }
- }
- }
-